<template>
  <el-tabs class="Fg-tabs-container" :type="type" :value="activeName" :style="newStyle">
    <el-tab-pane
      class="Fg-tips"
      v-for="item in list"
      :key="item.value"
      :label="item.label"
      :name="item.value"
    >
      <template #label>
        <span :style="newStyle.font">{{item.label}}</span>
      </template>
      <form-row-container
        :list.sync="item.children"
        :font="newStyle.font"
        v-bind="$attrs"
        :border="false"
      />
    </el-tab-pane>
  </el-tabs>
</template>
 
<script>
import { deepClone, toCamelCase } from "../../../utils/index";
import { comMixin } from "../../../utils/comMixins";
export default {
  mixins: [comMixin],
  name: "form-tabs-container",
  props: {
    value: {
      type: [String, Number],
      default: "",
    },
    list: {
      type: Array,
      default: () => [],
    },
    type: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      activeName: this.value || this.list[0]?.value,
      deepClone,
      toCamelCase,
    };
  },

  watch: {
    value(newValue) {
      this.activeName = newValue;
    },
  },
};
</script>

<style lang="scss" >
@import "../../../styles/generator.scss";
.Fg-tabs-container {
  .el-tabs__content {
    height: calc(100% - 44px);
    overflow: auto;
  }
}
</style>